<tagLib name="html" />
<include file="Public:header" />
<style>
    /*#leftPart{float:right;}
    #rightPart{float:left;}
    div.content{width:1000px !important;}*/
    #dg.tr {overflow: visible !important;height:auto}
    #borrow.tr {overflow: visible !important;height:auto}
    div.datagrid-cell{height: auto !important;}
</style>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/easyui/themes/icon.css">
	
<div id="main" class="main" >
<div class="content">
    
<div class="title">修改入住单 [ <a href="javascript:history.back()">返回列表</a>    <a href="__APP__/Housestats">返回房态</a>]
 <b style="margin-left:10px;">操作人</b>：{$vo.user_id|getModelName=User,nickname}
</div>
<load href="__PUBLIC__/Css/ui-lightness/jquery.ui.all.css"/>
       <load href="__PUBLIC__/Js/jquery-1.4.4.min.js"/>
       <load href="__PUBLIC__/Js/jquery-ui-1.8.12.tabsall.min.js"/>
       <script>
           $(function() {
               $( "#container" ).tabs();
           });
       </script>
       <div id="container" class="domtab">
           <ul>
               <li><a href="#item" rel="nofollow">基本信息</a></li>
               <li><a href="#cost">消费记录</a></li>
               <li><a href="#borrow">借还记录</a></li>
           </ul>
           <div id="item">
            <form method='post' id="form1" action="__URL__/update/" >
            <table cellpadding=3 cellspacing=3>
    <tr>
        <td class="tRight" >预订单号：</td>
        <td class="tLeft" >
            <eq name="_REQUEST.return" value="home">
            <input type="hidden" name="jumpUrl" value="__APP__/Public/main">
        </eq> 

            {$vo.order_id|getModelName='Order','order_no'}
        </td>
    </tr>
    <tr>
        <td class="tRight" >入住单号：</td>
        <td class="tLeft" >{$vo.checkin_no}      
        </td>
    </tr>
    <tr>
        <td class="tRight" ><span class="red">*</span>预订人：</td>
        <td class="tLeft" >
            <input type="hidden" name="member_id" value="{$vo.member_id}" ><a href="__APP__/Member/edit/id/{$vo.member_id}" target="_blank" >{$vo.member_name}</a>
        </td>
    </tr>
<tr>
	<td class="tRight" >房型：</td>
	<td class="tLeft">{$vo.room_id|getModelName=Room,house_id|getModelName=House} </td>
</tr>
<tr id="room_tr">
	<td class="tRight" ><span class="red">*</span>入住房间：</td>
	<td class="tLeft">
            <input type="hidden" id="room_id" name="room_id" value="{$vo.room_id}">
            <input type="text" id="room_no" name="room_no" value="{$vo.room_no}" readonly>
        </td>
</tr>
<tr>
	<td class="tRight" ><span class="red">*</span>入住：</td>
        <td class="tLeft" ><input type="text" class="medium" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="start_time" id="start_time1" value="{$vo.start_time|toDate}">
             &nbsp;&nbsp;<span class="red">*</span>离开：
            <input type="text" class="medium bLeft" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="end_time" id="end_time" value="{$vo.end_time|toDate}">
             &nbsp;&nbsp;实际离开：
            <input type="text" class="medium bLeft" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="end_realtime" id="end_realtime" value="{$vo.end_realtime|toDate}">
        </td>
</tr>
<tr>
	<td class="tRight" ><span class="red">*</span>入住人：</td>
	<td class="tLeft" >
            <input type="text" class="large" id="person_name" name="person_name" value="{$vo.person_name}">
        </td>
</tr>
<tr>
	<td class="tRight" >入住人数：</td>
	<td class="tLeft" >
            <input type="text" class="medium bLeft" name="person_num" value="{$vo.person_num}"></td>
</tr>
<tr>
	<td class="tRight" >预付款：</td>
	<td class="tLeft" ><input type="text" class="medium bLeft" name="advance_pay" id="advance_pay" value="{$vo.advance_pay}"></td>
</tr>
<tr>
	<td class="tRight" style="background:red;">押金：</td>
	<td class="tLeft" ><input type="text" class="medium bLeft" name="deposit" id="deposit" value="{$vo.deposit}" ></td>
</tr>
<tr>
	<td class="tRight" >已消费金额：</td>
	<td class="tLeft" ><input type="text" class="medium bLeft" name="cost_pay" value="{$vo.cost_pay}"></td>
</tr>
<tr>
	<td class="tRight" >结帐时间：</td>
	<td class="tLeft" ><input type="text" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="balance_time" value="{$vo.balance_time|toDate}"></td>
</tr>
<tr>
	<td class="tRight" >结帐金额：</td>
	<td class="tLeft" ><input type="text" class="medium bLeft" name="balance_money" value="{$vo.balance_money}"></td>
</tr>

<tr>
	<td class="tRight tTop">备注说明：</td>
	<td class="tLeft"><textarea class="large bLeft"  name="remark" rows="5" cols="57">{$vo.remark}</textarea></td>
</tr>
<tr>
	<td class="tRight">状态：</td>
	<td class="tLeft">
            <select class="middle bLeft"  name="status">
                 <volist name="checkinStatus" id="stvo">
                     <option value="{$key} " <eq name='vo.status' value='$key'>selected</eq> >{$stvo}</option>
                </volist>
            </select>
            &nbsp;&nbsp;提醒时间：<input type="text" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="medium bLeft" name="alert_time" value="{$vo.alert_time|toDate}">
        </td>
</tr>
<tr>
	<td></td>
	<td class="center">
        <input type="hidden" value="{$vo.id}" name="id">
	<input type="submit" value="保 存" class="small submit">
	<input type="reset" class="reset imgButton" onclick="javascript:history.back()" value="返回" >
	</td>
</tr>
</table>
</form>
   </div>
   <div id="cost">
       <html:imageBtn name="add" value="新增" click="addMore({$vo.id})" style="impBtn hMargin fLeft shadow" /> 
<table class="list">
  <tr>
    <th>费用</th><th>单价</th><th>开始</th> <th>开始时间</th><th>结束</th><th>结束时间</th>
    <th>使用量</th><th>金额</th><th>状态</th><th>登记时间</th><th>更新时间</th><th>备注</th>
    <th>编辑</th><th>删除</th>
  </tr>
  <volist name="costs" id="av">
    <form action="__APP__/Costdetail/update" method="post">
      <tr>
      <td>{:configList(C('cost_type'),$av['cost_type'],'cost_type')}</td>
      <td> <input type="text" name="unit_price" value="{$av.unit_price}" size=7> </td>
      <td><input type="text" name="start" value="{$av.start}" size=7></td>
      <td>
      <input type="text" id="start_time" name="start_time" value="{$av.start_time|toDate}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" /></td>
      <td><input type="text" name="end" value="{$av.end}" size=7></td>
      <td>
        <input type="text" id="start_time" name="end_time" value="{$av.end_time|toDate}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
      </td>
      <td><input type="text" name="total" value="{$av.total}" size=7></td>
      <td><input type="text" name="money" value="{$av.money}" size=7></td>
      <td>{:configList(C('coststatus'),$av['status'])}</td>
      <td>
        <input type="text" id="create_time" name="create_time" value="{$av.create_time|toDate}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
      </td>
      <td><input type="text" value="{$av.update_time|toDate}"> </td>
      <td><textarea name="remark">{$av.remark}</textarea> </td>
      <td>
        <input type="hidden" value="__URL__/edit1/id/{$vo.id}/#cost" name="jumpUrl">
        <input type="hidden" value="{$av.id}" name="id">
        <input type="submit" value="保存"  class="save imgButton">
      </td>
      <td>
      <a href="__APP__/Costdetail/foreverdelete/id/{$av.id}">删除</a>  
      </td>
    </tr>
  </form>
  </volist>
</table>
   </div><!--end of cost tabs-->
   <div id="borrow">
       
       <html:imageBtn name="add" value="新增" click="addBorrow({$vo.id})" style="impBtn hMargin fLeft shadow" /> 
<table class="list">
  <tr>
    <th>物品</th><th>价值</th><th>借出时间</th><th>归还时间</th>
    <th>状态</th><th>登记时间</th><th>更新时间</th><th>备注</th>
    <th>编辑</th><th>删除</th>
  </tr>
  <volist name="borrows" id="bo">
    <form action="__APP__/Borrow/update" method="post">
      <tr>
      <td><input type="text" name="name" value="{$bo.name}" size=7> </td>
      <td> <input type="text" name="money" value="{$bo.money}" size=7> </td>
      <td>
      <input type="text" id="start_time" name="start_time" value="{$bo.start_time|toDate}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" /></td>
      <td>
        <input type="text" id="start_time" name="end_time" value="{$bo.end_time|toDate}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
      </td>
      <td>{:configList(C('borrowstatus'),$bo['status'])}</td>
      <td>
        <input type="text" id="create_time" name="create_time" value="{$bo.create_time|toDate}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
      </td>
      <td>
        <input type="text" value="{$bo.update_time|toDate}">
      </td>
      <td><textarea name="remark">{$bo.remark}</textarea> </td>
      <td>
        <input type="hidden" value="__URL__/edit1/id/{$vo.id}/#borrow" name="jumpUrl">
        <input type="hidden" value="{$bo.id}" name="id">
        <input type="submit" value="保存"  class="save imgButton">
      </td>
      <td>
      <a href="__APP__/Borrow/foreverdelete/id/{$bo.id}">删除</a>  
      </td>
    </tr>
  </form>
  </volist>
</table>

   </div>     
        <!--借还记录-->
    </div><!---tap end-->

</div>
    
</div>


<load href="__PUBLIC__/Js/My97DatePicker/WdatePicker.js" />
<script type="text/javascript">
  function addMore(id){
    location.href ="__APP__/Costdetail/add/checkin_id/"+id;
  }
  function addBorrow(id){
    location.href ="__APP__/Borrow/add/checkin_id/"+id;
  }
</script>
